import QtQuick 2.15
import QtQuick.Controls 2.15
import "./../../Control/RadioJs.js" as RadioJs
import RadioGlobal 1.0 as RadioGlobal

Item {
    id: headItem

    signal loadHomePage()

    Button {
        id: homePage
        height: parent.height * 0.6
        width: 80
        anchors.verticalCenter: headItem.verticalCenter
        anchors.right: headItem.right
        text: "首页"
        onClicked: {
            headItem.loadHomePage()
            RadioJs.stopChannel()

            //重新加载history数据
            RadioJs.loadHistoryChannel()

//            console.log("index : " , RadioGlobal.RadioData.historyChannelCurrentIndex , " freq :" , RadioGlobal.RadioData.historyChannelModel.get( RadioGlobal.RadioData.historyChannelCurrentIndex ).freq )
            //播放默认页面数据
            RadioJs.playChannel( RadioGlobal.RadioData.historyChannelModel.get( RadioGlobal.RadioData.historyChannelCurrentIndex ).freq )
        }
    }
}
